<template>
  <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <ul>
      <li v-for="item in dataList" :key="item._id">
        <p>姓名：{{ item.name }}</p>
        <p>性别：{{ item.sex }}</p>
        <p>手机：{{ item.phone }}</p>
      </li>
    </ul>
  </div>
</template>

<script>
import userApi from "@/api/userApi.js";

export default {
  data() {
    return {
      dataList: []
    };
  },

  components: {},

  methods: {
    getData() {
      userApi.getList().then(res => {
        this.dataList = res.data.data;
      });
    }
  },

  created() {
    this.getData();

    console.log(this.$route, "用户中心");
  }
};
</script>

<style scoped>
</style>